package epoch.db.gamedb.provider;

import javax.sql.DataSource;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

import epoch.db.config.DBConfig;

public class JdbcProvider implements IDataSourceProvider{
	
	DBConfig config;
	MysqlDataSource dataSource;
	
	public JdbcProvider(){
		
	}
	
	public JdbcProvider(DBConfig config){
		this.config = config;
		dataSource = new MysqlDataSource();
		dataSource.setURL(config.DB_URL);
		dataSource.setUser(config.DB_USER);
		dataSource.setPassword(config.DB_PASSWORD);
	}
	
	@Override
	public DataSource getDataSource() {
		return dataSource;
	}

}
